﻿// (c) Copyright 2013 Mike Riedel.
// This source is subject to the Microsoft Public License (Ms-PL).
// All other rights reserved.

namespace System.Security.Cryptography
{
   /// <summary>
   /// Poor-mans substitute for full .NET framework version.
   /// This is *NOT* intended to actually protect data, which is rather difficult to do
   /// when running in a browser as a Silverlight plugin.  It merely allows the same
   /// code to be built against .NET and Silverlight.
   /// </summary>
   public static class ProtectedData
   {
      /// <summary>
      /// Protects the data.
      /// </summary>
      /// <param name="data"></param>
      /// <param name="salt"></param>
      /// <param name="scope"></param>
      /// <returns></returns>
      public static byte[] Protect(byte[] data, byte[] salt, DataProtectionScope scope)
      {
         // TODO: Obfuscate data, although there's hardly a point since this code is easily viewable since it's in the XAP file.
         return data;
      }

      /// <summary>
      /// Unprotects the data.
      /// </summary>
      /// <param name="encryptedData"></param>
      /// <param name="salt"></param>
      /// <param name="scope"></param>
      /// <returns></returns>
      public static byte[] Unprotect(byte[] encryptedData, byte[] salt, DataProtectionScope scope)
      {
         return encryptedData;
      }
   }
}
